package me.znext.learn.android;

import android.app.Notification;
import android.app.NotificationManager;
import android.os.Bundle;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.widget.ListView;

public class CourseSchedule extends AppCompatActivity {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_course_schedule);
    this.setTitle("我的课表");
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    final NotificationManager notificationManager = (NotificationManager) this.getSystemService(NOTIFICATION_SERVICE);
    ListView leftMenu = (ListView) findViewById(R.id.leftMenuList);
    DrawerLayout leftMenuDrawerLayout = (DrawerLayout) findViewById(R.id.leftMenuDrawerLayout);
    new LeftMenu(this, leftMenu, leftMenuDrawerLayout);
    Notification  notification = new Notification.Builder(this)
      .setAutoCancel(true)
      .setContentTitle("课程提醒")
      .setContentText("今天你有两门课要上哦")
      .setSmallIcon(R.drawable.ic_launcher)
      .build();
    notificationManager.notify(0x123, notification);
  }
}
